<template>
  <div class='page page-login'>
    <van-cell-group>
      <van-field
        v-model="username"
        clearable
        label="用户名"
        placeholder="请输入用户名"
      />
      <van-field
        v-model="password"
        type="password"
        label="密码"
        placeholder="请输入密码"
      />
    </van-cell-group>
    <van-button block @click='doLogin' class='mt-10'>登录</van-button>
  </div>
</template>

<script>
import { LoginUser } from "@/api";
export default {
  data() {
    return {
      username: "",
      password: ""
    };
  },
  methods: {
    doLogin() {
      LoginUser({
        UserAccount: this.username,
        UserPassword: this.password
      }).then(res => {
        console.log(res);
      });
    }
  }
};
</script>

<style lang="less" scoped>
.page-login {
  padding: 20px;
}
</style>
